package leetcode.other;

/**
 * @author cyt
 * @create 2020-07-27 9:03
 */
public class T392 {

    public static void main(String[] args) {
        String s1 = "bbbbb";
        String s2 = "aaabb";
        /*
         * 使用双指针 进行循环匹配
         */
        int n = s1.length(), m = s2.length();
        int i = 0, j = 0;
        while (i < n && j < m) {
            if (s1.charAt(i) == s2.charAt(j)) {
                i++;
            }
            j++;
        }
        System.out.println(i == n);
    }
}
